package com.bytedance.common.plugin.framework.model;

import org.json.JSONObject;

public final class DeletePluginItem extends PluginItem {
    private DeletePluginItem(String arg1, Integer arg2) {
        super(arg1, arg2);
    }

    public static DeletePluginItem fromJO(JSONObject jo) {
        if (jo != null) {
            try {
                return new DeletePluginItem(jo.optString("package_name"), jo.optInt("apk_version_code"));
            } catch (Exception e) {
                return null;
            }
        } else {
            return null;
        }
    }

    public final boolean a(PluginItem pluginItem) {
        return pluginItem == null || this.apkVersionCode.intValue() >= pluginItem.apkVersionCode.intValue();
    }

    protected final String getSpKey() {
        return "plugin_delete_" + this.packageName;
    }
}

